import request from 'util/request.js'


	function login(data){
		return request.service({
			url:'/api/v1/wechat/login',
			method:'POST',
			data
		})
	}

	function callback(data){
	   return request.service({
		   url:'/api/v1/wechat/callback',
		   method:'POST',
		   data
	   })
	}

	function getDetail(data){
		return request.service({
			   url:'/api/v1/user/getDetail',
			   // method:'Get',
			   data
		})
	}

	function getUpload(filePath,name,data){
		return request.sendUploadFile(
			   '/api/v1/attachment/upload',
			   filePath,
			   name,
			   data
		)
	}

	function sendSms(data){
		return request.service({
			   url:'/api/v1/user/sendSms',
			   data
		})
	}

	function updateUser(data){
		return request.service({
			   url:'/api/v1/user/updateUser',
			   method:'POST',
			   data
		})
	}

	function addCheckRecord(data){
		return request.service({
			   url:'/api/v1/room/addCheckRecord',
			   method:'POST',
			   data
		})
	}

	function getCheckRecord(data){
		return request.service({
			   url:'/api/v1/room/getCheckRecord',
			   // method:'POST',
			   data
		})
	}
	
	function getUserRecord(data){
		return request.service({
			   url:'/api/v1/room/getUserRecord',
			   // method:'POST',
			   data
		})
	}
	
	function createOrder(data){
		return request.service({
			   url:'/api/v1/order/create',
			   method:'POST',
			   data
		})
	}
	
	function getRecordList(data){
		return request.service({
			   url:'/api/v1/room/getRecordList',
			   // method:'POST',
			   data
		})
	}
	
	function addRepairRecord(data){
		return request.service({
			   url:'/api/v1/room/addRepairRecord',
			   method:'POST',
			   data
		})
	}
	
	function getRepairReocrd(data){
		return request.service({
			url:'/api/v1/room/getRepairReocrd',
			// method:'POST',
			data
		})
	}
	
	function getAdverts(data){
		return request.service({
			url:'/api/v1/message/getAdverts',
			// method:'POST',
			data
		})
	}
	
	function getMessage(data){
		return request.service({
			url:'/api/v1/message/getMessage',
			// method:'POST',
			data
		})
	}
	
	function MessageDetail(data){
		return request.service({
			url:'/api/v1/message/MessageDetail',
			// method:'POST',
			data
		})
	}

	function getUserRoom(data){
		return request.service({
			url:'/api/v1/room/getUserRoom',
			// method:'POST',
			data
		})
	}
	
	function getSurrounding(){
		return request.service({
			url:'/api/v1/message/getSurrounding',
			// method:'POST',
			// data
		})
	}
	
	function getSurroundDetail(data){
		return request.service({
			url:'/api/v1/message/getSurroundDetail',
			// method:'POST',
			data
		})
	}
	
	function getNewsDetail(data){
		return request.service({
			url:'/api/v1/message/getNewsDetail',
			// method:'POST',
			data
		})
	}
	
	function getRepairDetail(data){
		return request.service({
			url:'/api/v1/room/getRepairDetail',
			// method:'POST',
			data
		})
	}
	
	function saveRepair(data){
		return request.service({
			url:'/api/v1/room/saveRepair',
			method:'POST',
			data
		})
	}
	
	function getBuilding(){
		return request.service({
			url:'/api/v1/room/getBuilding',
			// method:'POST',
			// data
		})
	}
	
	function getRoomList(data){
		return request.service({
			url:'/api/v1/room/getRoomList',
			// method:'POST',
			data
		})
	}
	
	function getWaterEle(data){
		return request.service({
			url:'/api/v1/room/getWaterEle',
			// method:'POST',
			data
		})
	}
	
	function addWaterEleRecord(data){
		return request.service({
			url:'/api/v1/room/addWaterEleRecord',
			method:'POST',
			data
		})
	}
	
	function get_water_ele_list(){
		return request.service({
			url:'/api/v1/room/get_water_ele_list',
			// method:'POST',
			// data
		})
	}
	
	function getSubscribe(data){
		return request.service({
			url:'/api/v1/user/getSubscribe',
			// method:'POST',
			data
		})
	}
	
	function getQRcode(){
		return request.service({
			url:'/api/v1/wechat/getQRcode',
			// method:'POST',
			// data
		})
	}
	
	function updateUserInfo(data){
		return request.service({
			url:'/api/v1/user/updateUserInfo',
			// method:'POST',
			data
		})
	}
	
	function getPollingDevice(data){
		return request.service({
			url:'/api/v1/polling_record/getPollingDevice',
			// method:'POST',
			data
		})
	}
	
	function savePollingRecord(data){
		return request.service({
			url:'/api/v1/polling_record',
			method:'POST',
			data
		})
	}
	
	function getPollingRecord(data){
		return request.service({
			url:'/api/v1/polling_record',
			// method:'POST',
			data
		})
	}
	
	
	export default{
		login,  	  			//获取授权链接
		callback,     			//登录
		getDetail,	  			//获取用户详情
		getUpload,				//上传图片
		sendSms,				//发送手机验证码
		updateUser,				//绑定手机号码
		addCheckRecord,			//添加申请入住记录
		getCheckRecord,			//获取申请记录
		getUserRecord,			//获取用户缴费记录
		createOrder,			//创建支付订单
		getRecordList,			//获取用户全部缴费记录
		addRepairRecord, 		//添加报修记录
		getRepairReocrd,		//获取用户报修记录
		getAdverts,				//获取广告轮播图
		getMessage,				//获取消息通知
		MessageDetail,			//获取通知详情
		getUserRoom,			//获取用户房间信息
		getSurrounding,			//获取周边列表
		getSurroundDetail,		//获取周边详情
		getNewsDetail,			//获取新闻详情
		getRepairDetail,		//获取报修详情
		saveRepair,				//修改报修记录
		getBuilding,			//获取楼房号
		getRoomList,			//获取房间列表
		getWaterEle,			//获取上次水电表读数
		addWaterEleRecord,		//添加水电记录
		get_water_ele_list,		//获取水电记录
		getSubscribe,			//查询用户是否关注公众号
		getQRcode,				//获取临时二维码
		updateUserInfo,			//更新用户信息
		getPollingDevice,		//获取巡检设备列表
		savePollingRecord,		//添加巡检记录
		getPollingRecord		//获取巡检记录
	}